Malaria Data Modeling workshop

Introduction to uv, VSCode, Streamlit and Aider

📱 Follow Along on Your Device

Scan this code to view the slides on your phone or laptop:

What We’ll Cover Today

  1. Installing Tools - uv and Aider setup
  2. Project Initialization - Creating your workspace
  3. Configuration - OpenRouter API and Aider settings
  4. Installing Dependencies - Adding required libraries
  5. The Development Workflow - Building with AI
  6. Running the Application - Launching your dashboard

Part 1: Installation & Setup

Install uv

uv is an extremely fast Python package and project manager, written in Rust 🦀

Windows (using winget)

winget install --id astral-sh.uv

macOS & Linux (Ubuntu)

curl -LsSf https://astral.sh/uv/install.sh | sh

Check if installed correctly

uv --version

Install uv

uv is an extremely fast Python package and project manager, written in Rust 🦀

From Github releases

https://github.com/astral-sh/uv/releases

Why is uv So Fast?

Key Features

  • 10-100x faster than pip
  • Unified tool - replaces pip, poetry, pyenv
  • Reliable - global caching & lockfiles
  • Cross-platform - Mac, Windows, Linux

Built with Rust 🦀

  • Compiled to machine code
  • Parallel processing
  • No GC pauses
  • Minimal memory

Install Aider Globally

Using uv

uv tool install aider-chat --python 3.12 --force

What is Aider?

  • AI pair programmer in your terminal
  • Direct file editing
  • Git integration
  • Whole codebase context
  • Works with any LLM (we’ll use Gemini)

Part 2: Project Initialization

Download from Github repo

Download from Github repo

Unzip the file and cd into it

# move into the directory
cd MalariaDataModelingWorkshop-main

Part 3: Configuration

OpenRouter

Why we are choosing it:

  • Unified Access: Connect to Deepseek, OpenAI, Google, etc via one key.
  • Privacy First: Settings for “Zero Data Retention.”
  • Future Proof: New models are available almost immediately.
  • Best Prices: easy access to low-cost open-source models.

A “Universal Adapter” for AI

OpenRouter

Get the API KEY

https://openrouter.ai/

OpenRouter

Get the API KEY

Create Aider Config File

check the directory for the file below and edit:

example.aider.conf.yml

# ~/.aider.conf.yml

# 1. Add your openRouter API key
# Get one from https://openrouter.ai/settings/keys
api-key:
 - openrouter=sk-...
 

# 2. Set your default model
# Assuming we are using Deepseek...
model: deepseek/deepseek-v3.2
# 3. Optional: Enable caching to save on costs
cache-prompts: true

change the name to .aider.conf.yml and save

Security: Update .gitignore

Always protect your API keys

# Add to .gitignore
.aider.conf.yml
.env
*.env

Part 4: Installing Dependencies

Install Required Libraries

Add all dependencies upfront

uv sync

Why Install Dependencies First?

  • Aider will use them during test generation
  • TDD (Test-Driven Development) requires dependencies to be available
  • Ensures tests can run immediately
  • Prevents import errors during development

Part 5: The Development Workflow

Launch Aider

Basic Command

aider --no-auto-commits

You’ll see:

Aider v0.x.x
Model: gemini/gemini-1.5-pro-latest
Git repo: .git
>

If the last launch fails…

…try the following

uv run --with aider-chat python -m aider --model openrouter/Deepseek/deepseek-v3.2 --api-key openrouter=YOUR_OPENROUTER_API_KEY

The Four-Step Process

  1. Context & Requirements - Set up the “Expert” persona
  2. Freeze the Spec - Lock requirements to prevent scope creep
  3. Planning & TDD - Break work into testable tasks
  4. The Loop - Iterate through tasks automatically

Step A: Context & Requirements

The “Expert” Persona Approach

Copy the prompt from the PROMPT.md file and paste

Step B: Freezing the Spec

Lock Requirements

Once the PRD is generated, prevent AI from changing it:

/read-only context/PRD.md

Why?

  • Prevents scope creep
  • Maintains focus
  • Ensures consistency

Step C: Planning & TDD

Create Task List

This was already accomplished from the instructions on the PROMPT.md. You can check the folder visually to confirm.

What Aider Creates

Example Task List

## Tasks

- [ ] 1. Set up project structure
- [ ] 2. Create file upload component
- [ ] 3. Implement CSV validation
- [ ] 4. Add EDA functions
- [ ] 5. Create visualization module
- [ ] 6. Build main dashboard layout
- [ ] 7. Write tests for each component

Step D: The Loop

The Simple Iteration Command

Please proceed to the next task.

That’s it!

  • Aider checks off completed tasks
  • Moves to the next item
  • Writes code + tests
  • Commits to git
  • Repeat until done

Essential Aider Commands

  • /add file.py - Add file to context
  • /read-only file.py - Prevent modifications
  • /drop file.py - Remove from context
  • /ls - List files in context
  • /undo - Undo last change
  • /diff - Show pending changes
  • /help - Show all commands
  • /exit - Exit aider

Part 6: Running the Application

Launch the App

Using uv run

uv run streamlit run app.py

No activation needed!

uv run automatically uses the virtual environment

Key Principles

Isolated environments

  • Use uv for reproducible dependencies
  • Fast, reliable, consistent

Resources

Documentation

  • uv: docs.astral.sh/uv
  • OpenRouter: https://openrouter.ai/
  • Aider: aider.chat/docs
  • Streamlit: docs.streamlit.io

What’s Next?

  1. Set up your own dashboard project
  2. Try the expert persona approach
  3. Experiment with task decomposition
  4. Share your results with the team
  5. Build more AI-assisted projects!

Let’s Build Something Amazing! 🚀

Your Turn

Your next project

  1. Create a new folder for your new project
  2. From this project copy the pyproject.toml & .aider.conf.yml files

Let’s Build Something Amazing! {transition=“fade”}🚀

Your Turn

Your next project

  1. Paste these files into your new project
  2. Open the terminal from this new project
  3. Install dependencies with uv sync
  4. Follow the 4-step workflow
  5. Create your own PROMPT.md. Use ChatGPT to help you.
  6. Deploy your fresh dashboard!

Summary: Modern Python Development

  • uv - 10-100x faster package management
  • 🤖 Aider - AI pair programmer in your terminal
  • 🎯 OpenRouter - The Unified Interface for LLMs
  • 📊 Streamlit - Rapid dashboard development
  • 🔄 Iterative workflow - Expert persona + task loops

Questions?

Thank You! 🎉

Happy Vibe Coding! 💻✨

Get the entire files here.